﻿using zijian666.WorkScheduler.Abstractions;

namespace zijian666.WorkScheduler.Defines;
/// <summary>
/// 表示一个执行参数
/// </summary>
public class ActionArguments(IToken token)
{
    /// <summary>
    /// 令牌
    /// </summary>
    public IToken Token { get; } = token;

    /// <summary>
    /// 是否停止
    /// </summary>
    public bool IsStop => Token.IsDisposed;

    /// <summary>
    /// 停止
    /// </summary>
    public void Stop() => Token.TryDispose();
}
